//
//  KNJBaseViewController.m
//  KaNongJia
//
//  Created by RYX on 2018/11/20.
//  Copyright © 2018年 tuobu. All rights reserved.
//

#import "KNJBaseViewController.h"

@interface KNJBaseViewController ()

@end

@implementation KNJBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //解决设置导航栏不透明后界面下移问题
    //self.extendedLayoutIncludesOpaqueBars = YES;
    [self setAutomaticallyAdjustsScrollViewInsets:NO];
    
    self.view.backgroundColor = BACKGROUNDCOLOR;
}

#pragma mark - 带返回的navBar
- (void)setNavBarWithTitle:(NSString *)title
{
    self.title = title;
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImageName:@"icon_back_normal" selectedImageName:@"icon_back_normal" target:self action:@selector(back)];
}

- (void)back{
    
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark - MBProgress展示错误信息
- (void)showMBPError:(NSString *)msg{
    
    [self.view makeToast:msg duration:2.0 position:CSToastPositionCenter];
}

@end
